<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<body>
<script type="text/html" id="toolbarDemo">
	<div class="layui-btn-container">
		<button class="layui-btn layui-btn-sm" lay-event="add_panel">新增</button>
  	</div>
</script>

<script type="text/html" id="barDemo3">
		<button class="layui-btn layui-btn-sm" lay-event="details">详情</button>
        <button class="layui-btn layui-btn-sm" lay-event="delete2">删除</button>
	</script>
	<table class="layui-hide" id="coursewarev" lay-filter="coursewarev"></table>
	
	<script type="text/javascript">
		var option={
			elem:'#coursewarev',
			title:'班级状态',
			path:'coursewarev',
			addurl:'edit',
			toolbar:'#toolbarDemo',
			cols: [[
				{field: 'id', title: 'ID', hide: true, usersize: true, sort: true},
				{field: 'filename', title: '名称'},
				{field: 'resourceprofile', title: '资源简介'},
				{field: 'kcname', title: '课程'},
				{fixed: 'right', title:'操作', toolbar: '#barDemo3', width:200}
			]] 
		}
		var currRow="${param.currRow==null?'null':param.currRow}";
		var limit=${param.limit==null?'null':param.limit};
		var page=${param.page==null?'null':param.page};
		var classTable=new LayUiTable(option,currRow,limit,page);
		classTable.init();
		
		layui.use('table', function() {
			var table = layui.table;
			table.on('tool(coursewarev)', function(obj) {
				var data = obj.data;
				if (obj.event === "details") {
					layer.open({
						type : 2,
						title:"开放班级",
						shade : 0.3,
						shadeClose : true,
						anim : 5,
						content : 'video/details1?id=' + data.id,
						area : [ '550px', '330px' ],
						end : function() {
							
						}
					});
				}
			})
		})
	</script>
</body>
